package com.eax.ModelLayer;

import java.util.ArrayList;

public class ReservationCollectionModel {
	private ArrayList<ReservationModel> reservationCollection;

    public ReservationCollectionModel(){
        reservationCollection = new ArrayList<ReservationModel>();
    }

    public ReservationModel getReservationById(int id){
        ReservationModel reservation = null;

        for(ReservationModel m : reservationCollection){
            if(m.getId() == id){
                reservation = m;
            }
        }

        return reservation;
    }

	public void printAllReservations(){
		for(ReservationModel r : reservationCollection){
			r.printInfo();
			System.out.println();
		}
	}

	public ArrayList<ReservationModel> getAllReservations(){
		return reservationCollection;
	}

    public void addReservation(int id, int personID, int DVDID, String status, String reservationDate){
		ReservationModel newReservation = new ReservationModel(id, personID, DVDID, status, reservationDate);
		reservationCollection.add(newReservation);
    }

    public void removeReservation(ReservationModel reservationModel){
        reservationCollection.remove(reservationModel);
    }

    public int getSize(){
        return reservationCollection.size();
    }

    public ArrayList<ReservationModel> getList(){
        return reservationCollection;
    }
}